//
// Created by Administrator on 2020/11/4.
//

#include "bch.h"
#include "../../../../../../ccore/asn1c/codec/asn1Utils.h"

void RAN_MSCH_BCH_PreProcess(S_RanL2CellInst *pCellInst, S_RanMschCellInst *pMschCellInst)
{
    pCellInst->schRslt[pCellInst->schRsltIdx].bchExist = FALSE;
}

void RAN_MSCH_BCH_PostProcess(S_RanL2CellInst *pCellInst, S_RanMschCellInst *pMschCellInst)
{

}

void RAN_MSCH_BCH_Process(S_RanL2CellInst *pCellInst, S_RanMschCellInst *pMschCellInst)
{
    S_RanSchRslt *pSchRslt;

    pSchRslt = &pCellInst->schRslt[pCellInst->schRsltIdx];

    if (0 == pCellInst->schSfnSlot.slot && 0 == pCellInst->schSfnSlot.sfn % 8)
    {
        pSchRslt->bchExist = TRUE;
        ASN1_SetMibSfnMsb6Bit(pCellInst->mib, pCellInst->schSfnSlot.sfn);
        pSchRslt->bchSchRslt.bchPayload = (*(uint32_t*)pCellInst->mib) & 0xFFFFFF;
        RAN_ADD_DBG_CODE(RAN_DC_L2_SCH_MIB);
    }
}